<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<textarea  style="width:100%;height:100%">
package com.onluy.controller.${PACKAGE};


import java.util.List;
import com.github.pagehelper.PageInfo;
import com.onluy.framework.base.AppService;
import com.onluy.framework.data.bean.Pagination;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.onluy.framework.data.util.InParam;
import com.onluy.framework.system.annotation.ParamCheck;
import com.onluy.framework.base.AppController;
import com.onluy.framework.base.JsonResult;
import org.springframework.web.servlet.ModelAndView;
import com.onluy.entity.${PACKAGE}.${ControllerName};
import com.onluy.servic.${PACKAGE}.${ControllerName}Service;

@RestController
@RequestMapping("/${PACKAGE}/${ControllerName?lower_case}")
public class ${ControllerName}Controller extends AppController {


	@Autowired(required=true)
	private ${ControllerName}Service ${controllerName_Camel}Service;

	@Override
	public AppService service() {
		return ${controllerName_Camel}Service;
	}



	@RequestMapping("/index")
	@RequiresPermissions("F:index")
	public ModelAndView index(InParam<String, Object> inParam ){
		return super.index();
	}

	@RequestMapping(value = "/add")
	@RequiresPermissions("F:add")
	@ParamCheck(value={"attrCode:属性编码" })
	public JsonResult Add(InParam<String, Object> inParam,   ${ControllerName} ${controllerName_Camel} ) {
		if(${controllerName_Camel}.getDepartId() ==null) {
${controllerName_Camel}.setDepartId((long)2) ;
		}
		return super.Add(${controllerName_Camel});
	}

	@RequestMapping(value = "/update")
	@RequiresPermissions("F:update")
	@ParamCheck(value={"${idField}:${idField}"})
	public JsonResult Update(InParam<String, Object> inParam,${ControllerName} ${controllerName_Camel}) {
		return super.Update(${controllerName_Camel});
	}


	@RequestMapping(value = "/del")
	@RequiresPermissions("F:del")
	@ParamCheck(value={"${idField}:${idField}"})
	public JsonResult Del(InParam<String, Object> inParam,${ControllerName} ${controllerName_Camel}) {
		return super.Del(${controllerName_Camel});
	}


	@RequestMapping(value = "/list")
	@RequiresPermissions("F:list")
	public PageInfo<${ControllerName}> List(InParam<String, Object> inParam, Pagination pagination, ${ControllerName} ${controllerName_Camel}) {
		if(inParam.containsKey("departId")==false) {
			inParam.put("departId",2) ;
		}
		return super.List(pagination,inParam);
	}



	@RequestMapping(value = "/simplelist")
	@RequiresPermissions("F:list")
	public List<${ControllerName}> simplelist(InParam<String, Object> inParam , ${ControllerName} ${controllerName_Camel}) {
		return  super.simplelist(   inParam  );
	}
}
</textarea>
</body>
</html>
 